import request from "@/plugins/request";

var pre = "/property/order";

if (process.env.NODE_ENV !== "development") {
  pre = '/api/sa/empl-care' + pre;
}


// export function getPropertyOrderList(data) {
//   return request({
//     url: `${pre}/getPropertyOrderList`,
//     method: "post",
//     data: data
//   });
// }

export function getPropertyOrderListForApp(data) {
  return request({
    url: `${pre}/getPropertyOrderListForApp`,
    method: "post",
    data: data
  });
}


export function savePropertyOrder(data) {
  return request({
    url: `${pre}/savePropertyOrder`,
    method: "post",
    data,
  });
}

export function savePropertyOrderExtend(data) {
  return request({
    url: `${pre}/savePropertyOrderExtend`,
    method: "post",
    data,
  });
}

// export function getPropertyOrders(data) {
//     return request({
//         url: `${pre}/getPropertyOrders`,
//         method: "post",
//         data,
//     });
// }

export function confirm(data) {
  return request({
    url: `${pre}/confirm`,
    method: "post",
    data,
  });
}

export function noPromise(data) {
  return request({
    url: `${pre}/noPromise`,
    method: "post",
    data,
  });
}

export function returnByProperty(data) {
  return request({
    url: `${pre}/returnByProperty`,
    method: "post",
    data,
  });
}

// 查询服务订单详情
export function getPropertyServiceOrderInfo(srvOrderId) {
  return request({
    url: `${pre}/query?srvOrderId=${srvOrderId}`,
    method: 'get',
  });
}

export function delPropertyOrder(data) {
  return request({
    url: `${pre}/delPropertyOrder`,
    method: 'post',
    data
  });
}

export function cancelPropertyOrderByStaff(data) {
  return request({
    url: `${pre}/cancelPropertyOrderByStaff`,
    method: 'post',
    data
  });
}

export function getAllOrderGroupDay(srvItemId) {
  return request({
    url: `${pre}/getAllOrderGroupDay?srvItemId=${srvItemId}`,
    method: 'get',
  });
}


